package t4tools.splittingObjects.test;

import java.util.Comparator;

import t4tools.splittingObjects.model.Cell;
import t4tools.splittingObjects.model.Row;

public class ColorOrder implements Comparator<Row> {

	public int compare(Row o1, Row o2) {
		Cell cell = o1.getCell("favColors");
		Cell cell2 = o2.getCell("favColors");
		if (cell != null && cell2 != null) {
			String stringValue = cell.getStringValue();
			String stringValue2 = cell2.getStringValue();
			if (stringValue != null && stringValue2 != null) {
				return stringValue.compareTo(stringValue2);
			}
		}
		return 0;
	}

}
